module PostsHelper
  def is_show?
    params[:controller] == 'posts' and params[:action] == 'show'
  end

  # => 格式化tags
  def format_tags(tags)
    unless tags.blank?
      tags_links = "<span class=\"tags\">Tags: "
      tags_links += tags.split(/,|，/).map! {|tag| link_to tag, "/tags/#{tag}"}.join("　")
      tags_links += "</span>"
    end
  end
end
